﻿
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Blog.BlogComment') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new blog comment has been created for blog post "%BlogComment.BlogPostTitle%".</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.BackInStock') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Customer.FullName%, <br />Product <a target="_blank" href="%BackInStockSubscription.ProductUrl%">%BackInStockSubscription.ProductName%</a> is in stock.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.EmailValidationMessage') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<a href="%Store.URL%">%Store.Name%</a>  <br />  <br />  To activate your account <a href="%Customer.AccountActivationURL%">click here</a>.     <br />  <br />  %Store.Name%'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.NewPM') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />You have received a new private message.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.PasswordRecovery') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<a href="%Store.URL%">%Store.Name%</a>  <br />  <br />  To change your password <a href="%Customer.PasswordRecoveryURL%">click here</a>.     <br />  <br />  %Store.Name%'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.WelcomeMessage') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'We welcome you to <a href="%Store.URL%"> %Store.Name%</a>.<br /><br />You can now take part in the various services we have to offer you. Some of these services include:<br /><br />Permanent Cart - Any products added to your online cart remain there until you remove them, or check them out.<br />Address Book - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.<br />Order History - View your history of purchases that you have made with us.<br />Products Reviews - Share your opinions on products with our other customers.<br /><br />For help with any of our online services, please email the store-owner: <a href="mailto:%Store.Email%">%Store.Email%</a>.<br /><br />Note: This email address was provided on our registration page. If you own the email and did not register on our site, please send an email to <a href="mailto:%Store.Email%">%Store.Email%</a>.'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Forums.NewForumPost') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new post has been created in the topic <a href="%Forums.TopicURL%">"%Forums.TopicName%"</a> at <a href="%Forums.ForumURL%">"%Forums.ForumName%"</a> forum.<br /><br />Click <a href="%Forums.TopicURL%">here</a> for more info.<br /><br />Post author: %Forums.PostAuthor%<br />Post body: %Forums.PostBody%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Forums.NewForumTopic') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new topic <a href="%Forums.TopicURL%">"%Forums.TopicName%"</a> has been created at <a href="%Forums.ForumURL%">"%Forums.ForumName%"</a> forum.<br /><br />Click <a href="%Forums.TopicURL%">here</a> for more info.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'GiftCard.Notification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p>You have received a gift card for %Store.Name%</p><p>Dear %GiftCard.RecipientName%, <br /><br />%GiftCard.SenderName% (%GiftCard.SenderEmail%) has sent you a %GiftCard.Amount% gift cart for <a href="%Store.URL%"> %Store.Name%</a></p><p>You gift card code is %GiftCard.CouponCode%</p><p>%GiftCard.Message%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'NewCustomer.Notification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new customer registered with your store. Below are the customer''s details:<br />Full name: %Customer.FullName%<br />Email: %Customer.Email%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'NewReturnRequest.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] =  N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Customer.FullName% has just submitted a new return request. Details are below:<br />Request ID: %ReturnRequest.ID%<br />Product: %ReturnRequest.Product.Quantity% x Product: %ReturnRequest.Product.Name%<br />Reason for return: %ReturnRequest.Reason%<br />Requested action: %ReturnRequest.RequestedAction%<br />Customer comments:<br />%ReturnRequest.CustomerComment%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'News.NewsComment') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new news comment has been created for news "%NewsComment.NewsTitle%".</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'NewsLetterSubscription.ActivationMessage') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%NewsLetterSubscription.ActivationUrl%">Click here to confirm your subscription to our list.</a></p><p>If you received this email by mistake, simply delete it.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'NewVATSubmitted.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Customer.FullName% (%Customer.Email%) has just submitted a new VAT number. Details are below:<br />VAT number: %Customer.VatNumber%<br />VAT number status: %Customer.VatNumberStatus%<br />Received name: %VatValidationResult.Name%<br />Received address: %VatValidationResult.Address%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderCancelled.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Order.CustomerFullName%, <br />Your order has been cancelled. Below is the summary of the order. <br /><br />Order Number: %Order.OrderNumber%<br />Order Details: <a target="_blank" href="%Order.OrderURLForCustomer%">%Order.OrderURLForCustomer%</a><br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod%<br /><br />%Order.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderCompleted.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Order.CustomerFullName%, <br />Your order has been completed. Below is the summary of the order. <br /><br />Order Number: %Order.OrderNumber%<br />Order Details: <a target="_blank" href="%Order.OrderURLForCustomer%">%Order.OrderURLForCustomer%</a><br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod%<br /><br />%Order.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'ShipmentDelivered.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%"> %Store.Name%</a> <br /> <br /> Hello %Order.CustomerFullName%, <br /> Good news! You order has been delivered. <br /> Order Number: %Order.OrderNumber%<br /> Order Details: <a href="%Order.OrderURLForCustomer%" target="_blank">%Order.OrderURLForCustomer%</a><br /> Date Ordered: %Order.CreatedOn%<br /> <br /> <br /> <br /> Billing Address<br /> %Order.BillingFirstName% %Order.BillingLastName%<br /> %Order.BillingAddress1%<br /> %Order.BillingCity% %Order.BillingZipPostalCode%<br /> %Order.BillingStateProvince% %Order.BillingCountry%<br /> <br /> <br /> <br /> Shipping Address<br /> %Order.ShippingFirstName% %Order.ShippingLastName%<br /> %Order.ShippingAddress1%<br /> %Order.ShippingCity% %Order.ShippingZipPostalCode%<br /> %Order.ShippingStateProvince% %Order.ShippingCountry%<br /> <br /> Shipping Method: %Order.ShippingMethod% <br /> <br /> Delivered Products: <br /> <br /> %Shipment.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPlaced.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Order.CustomerFullName%, <br />Thanks for buying from <a href="%Store.URL%">%Store.Name%</a>. Below is the summary of the order. <br /><br />Order Number: %Order.OrderNumber%<br />Order Details: <a target="_blank" href="%Order.OrderURLForCustomer%">%Order.OrderURLForCustomer%</a><br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod%<br /><br />%Order.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPlaced.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Order.CustomerFullName% (%Order.CustomerEmail%) has just placed an order from your store. Below is the summary of the order. <br /><br />Order Number: %Order.OrderNumber%<br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod%<br /><br />%Order.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'ShipmentSent.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%"> %Store.Name%</a> <br /><br />Hello %Order.CustomerFullName%!, <br />Good news! You order has been shipped. <br />Order Number: %Order.OrderNumber%<br />Order Details: <a href="%Order.OrderURLForCustomer%" target="_blank">%Order.OrderURLForCustomer%</a><br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod% <br /> <br /> Shipped Products: <br /> <br /> %Shipment.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Product.ProductReview') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />A new product review has been written for product "%ProductReview.ProductName%".</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'QuantityBelow.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Product.Name% (ID: %Product.ID%) low quantity. <br /><br />Quantity: %Product.StockQuantity%<br /></p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'QuantityBelow.AttributeCombination.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Product.Name% (ID: %Product.ID%) low quantity. <br />%AttributeCombination.Formatted%<br />Quantity: %AttributeCombination.StockQuantity%<br /></p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'ReturnRequestStatusChanged.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Customer.FullName%,<br />Your return request #%ReturnRequest.ID% status has been changed.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Service.EmailAFriend') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%"> %Store.Name%</a> <br /><br />%EmailAFriend.Email% was shopping on %Store.Name% and wanted to share the following item with you. <br /><br /><b><a target="_blank" href="%Product.ProductURLForCustomer%">%Product.Name%</a></b> <br />%Product.ShortDescription% <br /><br />For more info click <a target="_blank" href="%Product.ProductURLForCustomer%">here</a> <br /><br /><br />%EmailAFriend.PersonalMessage%<br /><br />%Store.Name%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Wishlist.EmailAFriend') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%"> %Store.Name%</a> <br /><br />%Wishlist.Email% was shopping on %Store.Name% and wanted to share a wishlist with you. <br /><br /><br />For more info click <a target="_blank" href="%Wishlist.URLForCustomer%">here</a> <br /><br /><br />%Wishlist.PersonalMessage%<br /><br />%Store.Name%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'Customer.NewOrderNote') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Customer.FullName%, <br />New order note has been added to your account:<br />"%Order.NewNoteText%".<br /><a target="_blank" href="%Order.OrderURLForCustomer%">%Order.OrderURLForCustomer%</a></p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'RecurringPaymentCancelled.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Customer.FullName% (%Customer.Email%) has just cancelled a recurring payment ID=%RecurringPayment.ID%.</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPlaced.VendorNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />%Customer.FullName% (%Customer.Email%) has just placed an order. <br /><br />Order Number: %Order.OrderNumber%<br />Date Ordered: %Order.CreatedOn%<br /><br />%Order.Product(s)%</p>'
END
GO
 IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPaid.StoreOwnerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Order #%Order.OrderNumber% has been just paid<br />Date Ordered: %Order.CreatedOn%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPaid.CustomerNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Hello %Order.CustomerFullName%, <br />Thanks for buying from <a href="%Store.URL%">%Store.Name%</a>. Order #%Order.OrderNumber% has been just paid. Below is the summary of the order. <br /><br />Order Number: %Order.OrderNumber%<br />Order Details: <a href="%Order.OrderURLForCustomer%" target="_blank">%Order.OrderURLForCustomer%</a><br />Date Ordered: %Order.CreatedOn%<br /><br /><br /><br />Billing Address<br />%Order.BillingFirstName% %Order.BillingLastName%<br />%Order.BillingAddress1%<br />%Order.BillingCity% %Order.BillingZipPostalCode%<br />%Order.BillingStateProvince% %Order.BillingCountry%<br /><br /><br /><br />Shipping Address<br />%Order.ShippingFirstName% %Order.ShippingLastName%<br />%Order.ShippingAddress1%<br />%Order.ShippingCity% %Order.ShippingZipPostalCode%<br />%Order.ShippingStateProvince% %Order.ShippingCountry%<br /><br />Shipping Method: %Order.ShippingMethod%<br /><br />%Order.Product(s)%</p>'
END
GO
IF EXISTS (SELECT 1	FROM [MessageTemplate] WHERE [Name] = N'OrderPaid.VendorNotification') 
BEGIN 
Update [MessageTemplate] SET [Body] = N'<p><a href="%Store.URL%">%Store.Name%</a> <br /><br />Order #%Order.OrderNumber% has been just paid. <br /><br />Order Number: %Order.OrderNumber%<br />Date Ordered: %Order.CreatedOn%<br /><br />%Order.Product(s)%</p>'
END
GO